//
//  PHSecondViewController.m
//  Demo2
//
//  Created by bejoy on 14/12/15.
//  Copyright (c) 2014年 Phuoc Hai. All rights reserved.
//

#import "PHSecondViewController.h"
#import "PHAirViewController.h"
#import "Unit.h"


@interface PHSecondViewController ()

@end

@implementation PHSecondViewController


- (void)leftButtonTouch
{
    [self.airViewController showAirViewFromViewController:self.navigationController complete:nil];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    

    
    
    UIImage *image = [UIImage imageNamed:@"D-2"];
    UIScrollView *scrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, screen_Width, screen_Height-64)];
    scrollView.contentSize=CGSizeMake(image.size.width, image.size.height);
    scrollView.showsVerticalScrollIndicator=NO;
    [self.view addSubview:scrollView];
    
    UIImageView *iv = [[UIImageView alloc] initWithImage:image];
    iv.frame = CGRectMake(0, 0, image.size.width, image.size.height);
    [scrollView addSubview:iv];
    
    
    
    
    
    
    
    
    UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, 0, 44, 44);
    
    //    button.backgroundColor = [UIColor colorWithPatternImage:];
    [button setImage:[UIImage imageNamed:@"左上角-图标"] forState: UIControlStateNormal];
    [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(leftButtonTouch) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    
    
    
    //    [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:92/255.0 green:91/255.0 blue:91/255.0 alpha:1]];
    [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:250/255.0 green:250/255.0 blue:250/255.0 alpha:1]];
    [[UINavigationBar appearance] setTranslucent:NO];
    
    [[UINavigationBar appearance] setTitleTextAttributes:
     [NSDictionary dictionaryWithObjectsAndKeys:
      [UIColor colorWithRed:92/255.0 green:91/255.0 blue:91/255.0 alpha:1],
      UITextAttributeTextColor,
      [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
      UITextAttributeTextShadowColor,
      //      [NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
      //      UITextAttributeTextShadowOffset,
      [UIFont fontWithName:@"Arial-Bold" size:0.0],
      UITextAttributeFont,
      nil]];
    self.title = @"酷拉丁精选";
    
    typeof(self) bself = self;

    self.phSwipeHander = ^{
        [bself.airViewController showAirViewFromViewController:bself.navigationController complete:nil];
    };
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
